#include "head.h"

struct CommandMap CmdMap[CmdCount];

char command[255], argu[255];
char ErrorMessage[255];
char pMessageBuffer[MessageBufferSize];
int sockfd, new_fd;
int PortNumber;

#include "Preprocess.c"
#include "Dispatch.c"
#include "ProcessError.c"
#include "ProcessGet.c"
#include "ProcessPut.c"
#include "ProcessScd.c"
#include "ProcessSls.c"
#include "ProcessSpwd.c"
#include "ProcessExit.c"
#include "PrintDir.c"
#include "WriteBackClient.c"
#include "ConnectTerminals.c"
#include "Dispart.c"

int main(int argc, char ** argv)
{
	if(argc != 2)
	{
		fprintf(stderr, "Usage:%s PortNumber\a\n", argv[0]);
		exit(1);
	}

	if((PortNumber=atoi(argv[1])) < 0)
	{	
		fprintf(stderr, "Usage:%s PortNumber\a\n", argv[0]);
		exit(1);
	}

	Preprocess();
	ConnectTerminals();	

}
